package com.jysz.certificate.persistence.model.cm.applyAdd;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.StringUtils;

import com.jysz.certificate.persistence.model.system.Brand;
import com.jysz.certificate.persistence.model.system.Financial;
import com.jysz.certificate.persistence.model.system.Shop;
import com.jysz.webcore.ssh.entity.AbstractBaseEntity;

@Entity
@Table(name = "cm_applycer_list_")
@org.hibernate.annotations.Entity
public class ApplyCerList   extends AbstractBaseEntity<Long>  {

	/**
	 * 合格证批量申请单---申请列表
	 */
	private static final long serialVersionUID = 1L;
	private Shop shop;//销售店
	private Financial financial;//金融机构
	private Brand brand;//主机厂<品牌>
	private String certificationNum;//合格证号
	private Date departDate;//发车日期
	private String motorcycleType;// 车型
	private String chassis;// 车架号
	private String engine;//发动机号
	private String orderNumber;//  订单号
	private double supplyPrice;// 供货价begin
	private String draft;//  汇票号
	private Date draftBeginDate;//汇票号开始时间
	private Date draftEndDate;//汇票号结束时间
	private Date goingOutDate;// 出门日
	private Date scheduledDate;//预计到店日
	private Date createDate;//创建日期
	private Date leaveDate;//释放时间
//	private CopyOfCertificationImporting cmImporting;//合格证是否为导入标示
	private String state;//合格证状态
	private Date bulvDate;
	private ApplyCer applyCer ;
	
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_applyCer_id",columnDefinition="bigint(20)") 
	public ApplyCer getApplyCer() {
		return applyCer;
	}
	public void setApplyCer(ApplyCer applyCer) {
		this.applyCer = applyCer;
	}
	@Column(name = "_bulvDate")
	public Date getBulvDate() {
		return bulvDate;
	}
	public void setBulvDate(Date bulvDate) {
		this.bulvDate = bulvDate;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_financial_id",columnDefinition="bigint(20)") 
	public Financial getFinancial() {
		return financial;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_shop_id",columnDefinition="bigint(20)") 
	public Shop getShop() {
		return shop;
	}
	@ManyToOne(fetch = FetchType.LAZY)  
	@JoinColumn(name = "_brand_id",columnDefinition="bigint(20)") 
	public Brand getBrand() {
		return brand;
	}

	
	public void setShop(Shop shop) {
		this.shop = shop;
	}
	
	public void setFinancial(Financial financial) {
		this.financial = financial;
	}
	
	public void setBrand(Brand brand) {
		this.brand = brand;
	}
	@Column(name = "_certificationNum", columnDefinition="varchar(255)")
	public String getCertificationNum() {
		return certificationNum;
	}
	public void setCertificationNum(String certificationNum) {
		if(StringUtils.isNotBlank(certificationNum))
			certificationNum = certificationNum.toUpperCase();
		this.certificationNum = certificationNum;
	}
	@Column(name = "_departDate")
	public Date getDepartDate() {
		return departDate;
	}
	public void setDepartDate(Date departDate) {
		this.departDate = departDate;
	}
	@Column(name = "_motorcycleType",columnDefinition="varchar(255)")
	public String getMotorcycleType() {
		return motorcycleType;
	}
	public void setMotorcycleType(String motorcycleType) {
		this.motorcycleType = motorcycleType;
	}
	@Column(name = "_chassis", nullable = false, columnDefinition="varchar(255)")
	public String getChassis() {
		return chassis;
	}
	public void setChassis(String chassis) {
		if(StringUtils.isNotBlank(chassis))
			chassis = chassis.toUpperCase();
		this.chassis = chassis;
	}
	@Column(name = "_engine",columnDefinition="varchar(255)")
	public String getEngine() {
		return engine;
	}
	public void setEngine(String engine) {
		this.engine = engine;
	}
	@Column(name = "_orderNumber",columnDefinition="varchar(255)")
	public String getOrderNumber() {
		return orderNumber;
	}
	public void setOrderNumber(String orderNumber) {
		this.orderNumber = orderNumber;
	}
	@Column(name = "_supplyPrice",columnDefinition="numeric(9,2)")
	public double getSupplyPrice() {
		return supplyPrice;
	}
	public void setSupplyPrice(double supplyPrice) {
		this.supplyPrice = supplyPrice;
	}
	@Column(name = "_draft",columnDefinition="varchar(255)")
	public String getDraft() {
		return draft;
	}
	public void setDraft(String draft) {
		this.draft = draft;
	}
	@Column(name = "_draftBeginDate")
	public Date getDraftBeginDate() {
		return draftBeginDate;
	}
	public void setDraftBeginDate(Date draftBeginDate) {
		this.draftBeginDate = draftBeginDate;
	}
	@Column(name = "_draftEndDate")
	public Date getDraftEndDate() {
		return draftEndDate;
	}
	public void setDraftEndDate(Date draftEndDate) {
		this.draftEndDate = draftEndDate;
	}
	@Column(name = "_goingOutDate")
	public Date getGoingOutDate() {
		return goingOutDate;
	}
	public void setGoingOutDate(Date goingOutDate) {
		this.goingOutDate = goingOutDate;
	}
	@Column(name = "_scheduledDate")
	public Date getScheduledDate() {
		return scheduledDate;
	}
	public void setScheduledDate(Date scheduledDate) {
		this.scheduledDate = scheduledDate;
	}
	@Column(name = "_createDate")
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
//	@Column(name = "_receiveDate")
//	public Date getReceiveDate() {
//		return receiveDate;
//	}
//	public void setReceiveDate(Date receiveDate) {
//		this.receiveDate = receiveDate;
//	}
	@Column(name = "_leaveDate")
	public Date getLeaveDate() {
		return leaveDate;
	}
	public void setLeaveDate(Date leaveDate) {
		this.leaveDate = leaveDate;
	}
//	@Column(name = "_cmImporting",columnDefinition="int(11)")
//	@Enumerated(EnumType.ORDINAL)
//	public CopyOfCertificationImporting getCmImporting() {
//		return cmImporting;
//	}
//	public void setCmImporting(CopyOfCertificationImporting cmImporting) {
//		this.cmImporting = cmImporting;
//	}
	
	@Column(name = "_state",columnDefinition="varchar(50)")
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}


}
